﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Configuration;
using System;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
using System.Web.UI.WebControls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

public partial class agent_agent_property_search : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["email"] == null)
        {
            Response.Redirect("sessiont.aspx");
        }

        Label2.Text = Session["email"].ToString();
        if (Page.IsPostBack)
        {
        }
        else
        {
            GridView1.Visible = true;
        }
    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridView1.Visible = true;
    }
    protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridView1.Visible = true;
    }
    protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e)
    {

        GridView1.Visible = true;
    }
    protected void DropDownList5_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridView1.Visible = true;
    }
    protected void DropDownList6_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridView1.Visible = true;

    }
    protected void DropDownList7_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridView1.Visible = true;

    }
    protected void DropDownList8_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridView1.Visible = true;

    }
    protected void DropDownList9_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridView1.Visible = true;
    }
    protected void DropDownList10_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridView1.Visible = true;
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Session.Abandon();
        Response.Redirect("../admin.aspx");
    }


    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {

        if (e.CommandName == "edit")
        {

            //Label1.Text = "hello";
            int index = Convert.ToSByte(e.CommandArgument);

            GridViewRow row = GridView1.Rows[index];
            SqlDataAdapter adp = new SqlDataAdapter();
            SqlCommand cmd1 = new SqlCommand();
            DataSet ds = new DataSet();


            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Connstr"].ConnectionString);

            con.Open();

            SqlCommand objectvalue = new SqlCommand("", con);
            cmd1.Connection = con;



            SqlCommand dmc = new SqlCommand("select p_id from properties where p_id='" + row.Cells[0].Text + "'", con);

            dmc.ExecuteNonQuery();
            Session["p_id"] = row.Cells[0].Text;

            con.Close();
            // Response.Write(Session["p_id"]);
            // Response.Write(@"<script language='javascript'>alert('clent has been selected')</script>");

        
            // con.Close();


        }
    }

    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
   
}